package designPatterns.P02_工厂模式_Factory.P01_简单工厂.P01_PizzaStore.第2版_简单工厂.order;

import designPatterns.P02_工厂模式_Factory.P01_简单工厂.P01_PizzaStore.第2版_简单工厂.pizza.CheesePizza;
import designPatterns.P02_工厂模式_Factory.P01_简单工厂.P01_PizzaStore.第2版_简单工厂.pizza.GreekPizza;
import designPatterns.P02_工厂模式_Factory.P01_简单工厂.P01_PizzaStore.第2版_简单工厂.pizza.PepperPizza;
import designPatterns.P02_工厂模式_Factory.P01_简单工厂.P01_PizzaStore.第2版_简单工厂.pizza.Pizza;

public class SimpleFactory {
    public Pizza createPizza(String orderType) {
        Pizza pizza = null;
        switch (orderType) {
            case "greek":
                pizza = new GreekPizza("希腊");
                break;
            case "cheese":
                pizza = new CheesePizza("奶酪");
                break;
            case "pepper":
                pizza = new PepperPizza("胡椒");
            default:
                break;
        }

        return pizza;
    }
}
